#include "FbxSkeleton.h"

namespace GC
{
	
	GC::FbxSkeleton::FbxSkeleton( const FbxNode* a_skeletonNode, const FbxNode* a_rootNode)
		: m_id( FbxHelper::GetNodeID( a_skeletonNode ) ),
		m_name( a_skeletonNode->GetName() )
	{
		const FbxNode* f_parentNode = a_skeletonNode->GetParent();

		if (f_parentNode != NULL && f_parentNode != a_rootNode)
		{
			m_parentID = FbxHelper::GetNodeID( f_parentNode );
			m_parentName = f_parentNode->GetName();			
		}
		else
		{
			m_parentID = -1;
		}
		//These 2 needs to be deleted
		m_transform = FbxHelper::GetDQorMatrix4x4();		
		
		const FbxAMatrix f_transformMatrix = FbxAMatrix( a_skeletonNode->LclTranslation.Get(),  a_skeletonNode->LclRotation.Get(),  a_skeletonNode->LclScaling.Get() );
		FbxHelper::SetDQorMat4x4FromMat(f_transformMatrix, m_transform);
		
		bool f_poseFound = false;
		//Create pose data class
		const FbxHelper::FbxPoseData f_poseData( a_skeletonNode );		
	}

	const int GC::FbxSkeleton::GetID() const
	{
		return m_id;
	}
	const FbxString GC::FbxSkeleton::GetName() const
	{
		return m_name;
	}

	/// <summary>
	/// Returns -1 if there is no parent
	/// </summary>
	/// <returns></returns>
	const int GC::FbxSkeleton::GetParentID() const
	{
		return m_parentID;
	}
	const FbxString GC::FbxSkeleton::GetParentName() const
	{
		return m_parentName;
	}

	const VectorConstDouble GC::FbxSkeleton::GetTransform() const
	{
		return m_transform;
	}
}